home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8680 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: mother.usf.edu!scheifler!millert
  2. From: millert@scheifler.csee.usf.edu (Timothy Miller)
  3. Newsgroups: comp.lang.c++
  4. Subject: Trying to do weird function overloading
  5. Date: 26 Feb 1996 00:36:31 GMT
  6. Organization: University of South Florida
  7. Message-ID: <4gqvaf$msv@mother.usf.edu>
  8. NNTP-Posting-Host: scheifler.csee.usf.edu
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. Ok... here's a piece of one of my classes:
  12.  
  13.         friend Color scale(Color c1, double f);
  14.         friend Color scale(double f, Color c2);
  15.         Color scale(double f) { return scale(*this, f); }   
  16.  
  17. In the member function, I'm trying to call the friend function, but the 
  18. compiler is thinking that I'm trying to call the member function.  Now, 
  19. if I were trying to do this the other way around, I could use the scope 
  20. resolution operator to tell the friend function that I'm trying to access 
  21. the member function (even though I wouldn't need to, right?).  But here, 
  22. I'm trying to do the exact opposite... so how would I scope resolve outward?
  23.  
  24. --
  25. ---------------------------------------------------------------------------
  26. Timothy Miller, millert@grad.csee.usf.edu           Theoretical Linguistics
  27. http://www.csee.usf.edu/~millert         Music Theory, Computer Engineering
  28. ---------------------------------------------------------------------------
  29. Cunning linguists are very skilled with their tongues.
  30.